]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
shell-embedded-window: Remove hacks for old and fixed Clutter bug
authorJasper St. Pierre <jstpierre@mecheye.net>
Sun, 25 Mar 2012 10:02:17 +0000 (07:02 -0300)
committerJasper St. Pierre <jstpierre@mecheye.net>
Fri, 13 Jul 2012 21:28:50 +0000 (17:28 -0400)
We used to use realize/unrealize instead of map/unmap in ShellEmbeddedWindow
because there originally was no map/unmap. The days of this are long gone...

https://bugzilla.gnome.org/show_bug.cgi?id=672790

src/shell-embedded-window-private.h
src/shell-embedded-window.c
src/shell-gtk-embed.c

index 1c696db0046ccbdf75dbdc046d6bb424637f56dc..5714af99b6ed70d01f2382b823b5c2dfedd85328 100644 (file)
@@ -14,7 +14,7 @@ void _shell_embedded_window_allocate (ShellEmbeddedWindow *window,
                                      int                  width,
                                      int                  height);
 
-void _shell_embedded_window_realize   (ShellEmbeddedWindow *window);
-void _shell_embedded_window_unrealize (ShellEmbeddedWindow *window);
+void _shell_embedded_window_map (ShellEmbeddedWindow *window);
+void _shell_embedded_window_unmap (ShellEmbeddedWindow *window);
 
 #endif /* __SHELL_EMBEDDED_WINDOW_PRIVATE_H__ */
index abc29ac8917bd12f31df431bc835d0125841ddba..d1d273fe07471e6a694cf54baa10a93936b8f0d7 100644 (file)
  *  - ShellGtkEmbed is created for the ShellEmbeddedWindow
  *  - actor is added to a stage
  *
- * Ideally, the way it would work is that the GtkWindow is mapped
- * if and only if both:
+ * The way it works is that the GtkWindow is mapped if and only if both:
  *
- * - GTK_WIDGET_VISIBLE (window) [widget has been shown]
+ * - gtk_widget_visible (window) [widget has been shown]
  * - Actor is mapped [actor and all parents visible, actor in stage]
- *
- * Implementing this perfectly is not currently possible, due to problems
- * in Clutter, see:
- *
- * http://bugzilla.openedhand.com/show_bug.cgi?id=1138
- *
- * So until that is fixed we use the "realized" state of the ClutterActor
- * as a stand-in for the ideal mapped state, this will work as long
- * as the ClutterActor and all its parents are in fact visible.
  */
 
 G_DEFINE_TYPE (ShellEmbeddedWindow, shell_embedded_window, GTK_TYPE_WINDOW);
@@ -232,7 +222,7 @@ _shell_embedded_window_set_actor (ShellEmbeddedWindow  *window,
   window->priv->actor = actor;
 
   if (actor &&
-      CLUTTER_ACTOR_IS_REALIZED (actor) &&
+      CLUTTER_ACTOR_IS_MAPPED (actor) &&
       gtk_widget_get_visible (GTK_WIDGET (window)))
     gtk_widget_map (GTK_WIDGET (window));
 }
@@ -272,7 +262,7 @@ _shell_embedded_window_allocate (ShellEmbeddedWindow *window,
 }
 
 void
-_shell_embedded_window_realize (ShellEmbeddedWindow *window)
+_shell_embedded_window_map (ShellEmbeddedWindow *window)
 {
   g_return_if_fail (SHELL_IS_EMBEDDED_WINDOW (window));
 
@@ -281,7 +271,7 @@ _shell_embedded_window_realize (ShellEmbeddedWindow *window)
 }
 
 void
-_shell_embedded_window_unrealize (ShellEmbeddedWindow *window)
+_shell_embedded_window_unmap (ShellEmbeddedWindow *window)
 {
   g_return_if_fail (SHELL_IS_EMBEDDED_WINDOW (window));
 
index fded8ed284f3232086862c0b19882c2cbc95ce18..8120e1eb2e711dc5ffd2d5bd36cfff6d179b3909 100644 (file)
@@ -199,23 +199,23 @@ shell_gtk_embed_allocate (ClutterActor          *actor,
 }
 
 static void
-shell_gtk_embed_realize (ClutterActor *actor)
+shell_gtk_embed_map (ClutterActor *actor)
 {
   ShellGtkEmbed *embed = SHELL_GTK_EMBED (actor);
 
-  _shell_embedded_window_realize (embed->priv->window);
+  _shell_embedded_window_map (embed->priv->window);
 
-  CLUTTER_ACTOR_CLASS (shell_gtk_embed_parent_class)->realize (actor);
+  CLUTTER_ACTOR_CLASS (shell_gtk_embed_parent_class)->map (actor);
 }
 
 static void
-shell_gtk_embed_unrealize (ClutterActor *actor)
+shell_gtk_embed_unmap (ClutterActor *actor)
 {
   ShellGtkEmbed *embed = SHELL_GTK_EMBED (actor);
 
-  _shell_embedded_window_unrealize (embed->priv->window);
+  _shell_embedded_window_unmap (embed->priv->window);
 
-  CLUTTER_ACTOR_CLASS (shell_gtk_embed_parent_class)->unrealize (actor);
+  CLUTTER_ACTOR_CLASS (shell_gtk_embed_parent_class)->unmap (actor);
 }
 
 static void
@@ -243,8 +243,8 @@ shell_gtk_embed_class_init (ShellGtkEmbedClass *klass)
   actor_class->get_preferred_width = shell_gtk_embed_get_preferred_width;
   actor_class->get_preferred_height = shell_gtk_embed_get_preferred_height;
   actor_class->allocate = shell_gtk_embed_allocate;
-  actor_class->realize = shell_gtk_embed_realize;
-  actor_class->unrealize = shell_gtk_embed_unrealize;
+  actor_class->map = shell_gtk_embed_map;
+  actor_class->unmap = shell_gtk_embed_unmap;
 
   g_object_class_install_property (object_class,
                                    PROP_WINDOW,